home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume6 / conquer4 / patch4c < prev    next >
Encoding:
Internet Message Format  |  1989-08-08  |  35.7 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i003:  conquer4 - middle earth multi-player game (V4), Patch4c
  5. Message-ID: <4413@tekred.CNA.TEK.COM>
  6. Date: 7 Aug 89 13:51:58 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1183
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Adam Bryant <adb@cs.bu.edu>
  12. Posting-number: Volume 8, Issue 3
  13. Archive-name: conquer4/Patch4c
  14. Patch-To: conquer4: Volume 6, Issue 83-97
  15.  
  16.  
  17. #!/bin/sh
  18. # this is part 3 of a multipart archive
  19. # do not concatenate these parts, unpack them in order with /bin/sh
  20. # file patchV4.04 continued
  21. #
  22. CurArch=3
  23. if test ! -r s2_seq_.tmp
  24. then echo "Please unpack part 1 first!"
  25.      exit 1; fi
  26. ( read Scheck
  27.   if test "$Scheck" != $CurArch
  28.   then echo "Please unpack part $Scheck next!"
  29.        exit 1;
  30.   else exit 0; fi
  31. ) < s2_seq_.tmp || exit 1
  32. sed 's/^X//' << 'SHAR_EOF' >> patchV4.04
  33. X           if ((fexe=fopen(name,"a"))==NULL) {
  34. X              beep();
  35. X!             fprintf(stderr,"error opening %s\n",name);
  36. X              unlink(fison);
  37. X              exit(FAIL);
  38. X           }
  39. X          curntn = &ntn[country];
  40. X  
  41. X!         fprintf(stderr,"\n");
  42. X          readdata();
  43. X          execute(FALSE);
  44. X  
  45. X***************
  46. X*** 847,853 ****
  47. X--- 909,975 ----
  48. X      }
  49. X  }
  50. X  
  51. X+ #ifdef DEBUG
  52. X  /************************************************************************/
  53. X+ /*    SECT_INFO() - display sector debugging information        */
  54. X+ /************************************************************************/
  55. X+ void
  56. X+ sect_info()
  57. X+ {
  58. X+     int i,j,acnt1=0,acnt2=0,ncnt1=0,ncnt2=0,x,y;
  59. X+ 
  60. X+     /* erase prior information */
  61. X+     for(i=0;i<LINES-13;i++) {
  62. X+         move(i,COLS-21);
  63. X+         clrtoeol();
  64. X+     }
  65. X+     
  66. X+     standout();
  67. X+     mvaddstr(0,COLS-20,"Sector Information");
  68. X+     mvprintw(1,COLS-20,"  x = %2d, y = %2d  ",(int)XREAL,(int)YREAL);
  69. X+     standend();
  70. X+     
  71. X+     /* find units in the sector */
  72. X+     for (i=0;i<NTOTAL;i++) if (ntn[i].active != INACTIVE) {
  73. X+         x = 0;
  74. X+         for (j=0;j<MAXARM;j++) {
  75. X+             if (ntn[i].arm[j].sold > 0 && ntn[i].arm[j].xloc == XREAL
  76. X+                 && ntn[i].arm[j].yloc == YREAL ) x++;
  77. X+         }
  78. X+         y = 0;
  79. X+         for (j=0;j<MAXNAVY;j++) {
  80. X+             if (ntn[i].nvy[j].xloc != XREAL ||
  81. X+                 ntn[i].nvy[j].yloc != YREAL ) continue;
  82. X+             if (ntn[i].nvy[j].warships!=0 ||
  83. X+                 ntn[i].nvy[j].merchant!=0 ||
  84. X+                 ntn[i].nvy[j].galleys!=0) y++;
  85. X+         }
  86. X+         if (i!=country) {
  87. X+             acnt2 += x;
  88. X+             ncnt2 += y;
  89. X+         } else {
  90. X+             acnt1 = x;
  91. X+             ncnt1 = y;
  92. X+         }
  93. X+     }
  94. X+ 
  95. X+     mvprintw(3,COLS-20,"Own A_Units: %d", acnt1);
  96. X+     mvprintw(4,COLS-20,"Own N_Units: %d", ncnt1);
  97. X+     mvprintw(5,COLS-20,"Other A_Units: %d", acnt2);
  98. X+     mvprintw(6,COLS-20,"Other N_Units: %d", ncnt2);
  99. X+ 
  100. X+     mvprintw(8,COLS-20,"Occval: %d", occ[XREAL][YREAL]);
  101. X+ 
  102. X+     /* let them look at the information */
  103. X+     errormsg("");
  104. X+ 
  105. X+     /* fix the display */
  106. X+     makeside(FALSE);
  107. X+     makebottom();
  108. X+ }
  109. X+ #endif /* DEBUG */
  110. X+ 
  111. X+ /************************************************************************/
  112. X  /*    MAKESIDE() -    make the right hand side display        */
  113. X  /************************************************************************/
  114. X  void
  115. X***************
  116. X*** 1182,1188 ****
  117. X      nocrmode();
  118. X      endwin();
  119. X      if (fexe!=NULL) fclose(fexe);
  120. X!     printf("quit & save\n");
  121. X      exit(SUCCESS);
  122. X  }
  123. X  
  124. X--- 1304,1310 ----
  125. X      nocrmode();
  126. X      endwin();
  127. X      if (fexe!=NULL) fclose(fexe);
  128. X!     fprintf(stderr,"quit & save\n");
  129. X      exit(SUCCESS);
  130. X  }
  131. X  
  132. X*** onpc.c    Sun Aug  6 20:55:35 1989
  133. X--- npc.c    Sun Aug  6 20:55:49 1989
  134. X***************
  135. X*** 111,118 ****
  136. X          }
  137. X          count=0;
  138. X          while( TRUE ) {
  139. X!             x=(int)P_AXLOC+rand()%5-2;
  140. X!             y=(int)P_AYLOC+rand()%5-2;
  141. X  
  142. X              if( count++ > 100 ) {
  143. X                  P_ASOLD=0;
  144. X--- 111,118 ----
  145. X          }
  146. X          count=0;
  147. X          while( TRUE ) {
  148. X!             x=(int)P_AXLOC+rand()%3-1;
  149. X!             y=(int)P_AYLOC+rand()%3-1;
  150. X  
  151. X              if( count++ > 100 ) {
  152. X                  P_ASOLD=0;
  153. X***************
  154. X*** 139,144 ****
  155. X--- 139,145 ----
  156. X              break;
  157. X          }
  158. X      }
  159. X+ #ifdef MORE_MONST
  160. X      /* place a few new Nomad armies */
  161. X      for(armynum=0;armynum<MAXARM;armynum++) if(P_ASOLD<=0){
  162. X          if(rand()%4!=0) continue;
  163. X***************
  164. X*** 152,157 ****
  165. X--- 153,159 ----
  166. X              P_ASTAT=ATTACK;
  167. X          }
  168. X      }
  169. X+ #endif /* MORE_MONST */
  170. X  }
  171. X  
  172. X  void
  173. X***************
  174. X*** 187,192 ****
  175. X--- 189,195 ----
  176. X              }
  177. X          }
  178. X      }
  179. X+ #ifdef MORE_MONST
  180. X      /* place a few new savage armies */
  181. X      for(armynum=0;armynum<MAXARM;armynum++) if(P_ASOLD<=0){
  182. X          x=(rand()%(MAPX-8))+4;
  183. X***************
  184. X*** 204,209 ****
  185. X--- 207,213 ----
  186. X              P_ASTAT=ATTACK;
  187. X          }
  188. X      }
  189. X+ #endif /* MORE_MONST */
  190. X  }
  191. X  
  192. X  void
  193. X***************
  194. X*** 251,261 ****
  195. X--- 255,267 ----
  196. X                  P_NYLOC= ntn[x].nvy[y].yloc;
  197. X              }
  198. X          }
  199. X+ #ifdef MORE_MONST
  200. X          if(rand()%15==0) {
  201. X              /*randomly add one warship to pirate fleet*/
  202. X              shipsize = rand()%(N_HEAVY-N_LIGHT+1);
  203. X              (void) NADD_WAR(1);
  204. X          }
  205. X+ #endif /* MORE_MONST */
  206. X      }
  207. X  }
  208. X  #endif MONSTER
  209. X***************
  210. X*** 550,555 ****
  211. X--- 556,562 ----
  212. X          diff=curntn->tmil-(6*ideal/5);
  213. X          for(armynum=1;done==FALSE && armynum<MAXARM;armynum++){
  214. X              if((P_ASOLD<=0)
  215. X+             ||(P_ATYPE==A_ZOMBIE)
  216. X              ||(P_ATYPE==A_MILITIA)
  217. X              ||(P_ATYPE>=MINLEADER)
  218. X              ||(P_ASTAT==ONBOARD)
  219. X***************
  220. X*** 711,717 ****
  221. X      for(x=1;x<NTOTAL;x++) if( isntn(ntn[x].active) ){
  222. X          hostile = svhostile;
  223. X          if(npctype(curntn->active) != npctype(ntn[x].active)) 
  224. X!             hostile+=20;    /* not same allignment */
  225. X          friendly = 60-hostile;
  226. X               if( curntn->active==ISOLATIONIST ) friendly -= 20;
  227. X          /* negate impact of above line on neutrals */
  228. X--- 718,724 ----
  229. X      for(x=1;x<NTOTAL;x++) if( isntn(ntn[x].active) ){
  230. X          hostile = svhostile;
  231. X          if(npctype(curntn->active) != npctype(ntn[x].active)) 
  232. X!             hostile+=20;    /* not same alignment */
  233. X          friendly = 60-hostile;
  234. X               if( curntn->active==ISOLATIONIST ) friendly -= 20;
  235. X          /* negate impact of above line on neutrals */
  236. X***************
  237. X*** 826,832 ****
  238. X      float    hunger;
  239. X      long zz;
  240. X      check();
  241. X!     prep(country,FALSE);
  242. X  
  243. X      for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) attr[x][y]=0;
  244. X  
  245. X--- 833,839 ----
  246. X      float    hunger;
  247. X      long zz;
  248. X      check();
  249. X!     prep(country,FALSE,FALSE);
  250. X  
  251. X      for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) attr[x][y]=0;
  252. X  
  253. X***************
  254. X*** 1079,1085 ****
  255. X          if(curntn->metals >  3 * METALORE * curntn->tmil*x){
  256. X              curntn->dplus+=1;
  257. X              curntn->metals-=METALORE*curntn->tmil*x;
  258. X!             printf("\tnation %s buys +1 percent defence\n",curntn->name);
  259. X          }
  260. X      }
  261. X      /* don't allow status ATTACK from own city */
  262. X--- 1086,1092 ----
  263. X          if(curntn->metals >  3 * METALORE * curntn->tmil*x){
  264. X              curntn->dplus+=1;
  265. X              curntn->metals-=METALORE*curntn->tmil*x;
  266. X!             printf("\tnation %s buys +1 percent defense\n",curntn->name);
  267. X          }
  268. X      }
  269. X      /* don't allow status ATTACK from own city */
  270. X***************
  271. X*** 1127,1135 ****
  272. X  {
  273. X  #ifdef XENIX
  274. X      register int z;
  275. X- #else
  276. X-     register int x,y;
  277. X  #endif /*XENIX*/
  278. X  
  279. X      /* around capitol */
  280. X      for(x=(int)curntn->capx-4;x<=(int)curntn->capx+4;x++){
  281. X--- 1134,1141 ----
  282. X  {
  283. X  #ifdef XENIX
  284. X      register int z;
  285. X  #endif /*XENIX*/
  286. X+     register int x,y;
  287. X  
  288. X      /* around capitol */
  289. X      for(x=(int)curntn->capx-4;x<=(int)curntn->capx+4;x++){
  290. X*** ocheck.c    Sun Aug  6 20:55:33 1989
  291. X--- check.c    Sun Aug  6 20:55:50 1989
  292. X***************
  293. X*** 55,61 ****
  294. X                  __file__,__line__,country,i,a->xloc,a->yloc);
  295. X                  a->sold = 0;
  296. X              }
  297. X!             if( sct[a->xloc][a->yloc].altitude==WATER ) {
  298. X                  fprintf( stderr, "file %s: line %d: nation[%d] army[%d] loc=%d,%d (water) men=%d\n",
  299. X                  __file__,__line__,country,i,a->xloc,a->yloc,a->sold);
  300. X                  a->sold = 0;
  301. X--- 55,61 ----
  302. X                  __file__,__line__,country,i,a->xloc,a->yloc);
  303. X                  a->sold = 0;
  304. X              }
  305. X!             if( a->stat != ONBOARD && sct[a->xloc][a->yloc].altitude==WATER ) {
  306. X                  fprintf( stderr, "file %s: line %d: nation[%d] army[%d] loc=%d,%d (water) men=%d\n",
  307. X                  __file__,__line__,country,i,a->xloc,a->yloc,a->sold);
  308. X                  a->sold = 0;
  309. X***************
  310. X*** 63,69 ****
  311. X          } /* for */
  312. X  
  313. X          for( i = 0; i < NTOTAL; i++ ) {
  314. X!             if( nptr->dstatus[i] > JIHAD ) {
  315. X                  fprintf( stderr, "file %s: line %d: nation[%d] diplomatic status with %d = %d\n",
  316. X                      __file__, __line__, country, i, nptr->dstatus[i] );
  317. X                  nptr->dstatus[i] = WAR;
  318. X--- 63,76 ----
  319. X          } /* for */
  320. X  
  321. X          for( i = 0; i < NTOTAL; i++ ) {
  322. X!             if( ntn[i].active >= NPC_PEASANT ) {
  323. X!                 if ( nptr->dstatus[i] != WAR ) {
  324. X!                     nptr->dstatus[i] = WAR;
  325. X!                 }
  326. X!                 if ( ntn[i].dstatus[country] != WAR ) {
  327. X!                     ntn[i].dstatus[country] = WAR;
  328. X!                 }
  329. X!             } if( nptr->dstatus[i] > JIHAD ) {
  330. X                  fprintf( stderr, "file %s: line %d: nation[%d] diplomatic status with %d = %d\n",
  331. X                      __file__, __line__, country, i, nptr->dstatus[i] );
  332. X                  nptr->dstatus[i] = WAR;
  333. X*** otxt0    Sun Aug  6 20:55:35 1989
  334. X--- txt0    Sun Aug  6 20:55:50 1989
  335. X***************
  336. X*** 89,98 ****
  337. X  promoted to demi-god status.
  338. X  
  339. X        The demi-god may perform all of the godly functions for his world,
  340. X! including updates and nation alterations.  But alas he is only watching
  341. X! over the world and is not it's owner, so he may not create a new world or
  342. X! cause the destruction of the world he watches.  The demi-god for each
  343. X! world is indicated in the campaign information display ('I').
  344. X  
  345. X        Perhaps god is looking for people to run his worlds.  Send mail
  346. X  to XLOGIN and you may find out.
  347. X--- 89,99 ----
  348. X  promoted to demi-god status.
  349. X  
  350. X        The demi-god may perform all of the godly functions for his world,
  351. X! including updates and nation alterations.  He may even rebuild the current
  352. X! world from the beginning, if god grants him that power.  The only definite
  353. X! restrictions are that he may not create a completely new world or effect any
  354. X! world, other than his own.  The demi-god for each world is indicated
  355. X! in the campaign information display ('I').
  356. X  
  357. X        Perhaps god is looking for people to run his worlds.  Send mail
  358. X  to XLOGIN and you may find out.
  359. X*** otxt1    Sun Aug  6 20:55:35 1989
  360. X--- txt1    Sun Aug  6 20:55:50 1989
  361. X***************
  362. X*** 137,161 ****
  363. X  END
  364. X                              VIEWING THE WORLD
  365. X  
  366. X! When you log in, you will notice that you can only see a part of the
  367. X! world.  You must discover the world by getting certain magical powers,
  368. X! by taking land, or by moving armies and navies.  The use of SCOUT armies
  369. X! is intended for this purpose.
  370. X  
  371. X  The 'd' command allows you to change what you see on the map.  You can
  372. X  alter the information in the sector and can  change the type of sectors that
  373. X! are highlighted as follows:
  374. X  
  375. X! viewing options:  (d)esignation, (r)ace, (M)ove cost, (p)eople, (D)efense
  376. X!    (f)ood, (c)ontour, (v)egetation, (m)etal, (n)ation mark, (j)ewels, (i)tems
  377. X! highlight option: (o)wner (a)rmy (y)our Army, move (l)eft, (s)pecial, (x)=none
  378. X! toggle move mode: hit '/'
  379. X  
  380. X! Move mode ('/' toggle) will display both the current display as well as
  381. X! the move cost for each sector along side.
  382. X  
  383. X! I have tried to make the use of these options clear and self explanatory.
  384. X! Roman numerals (for population...) indicate thousands of people.
  385. X  END
  386. X                          COMMERCE AND TRADING
  387. X  
  388. X--- 137,202 ----
  389. X  END
  390. X                              VIEWING THE WORLD
  391. X  
  392. X! When you first log in, you will notice that you can only see a portion of the
  393. X! entire world.  Your range of vision is determined by the magic powers you
  394. X! possess and the location of your sectors and armies.  Scouts are useful to
  395. X! expand the amount of land you can view.
  396. X  
  397. X  The 'd' command allows you to change what you see on the map.  You can
  398. X  alter the information in the sector and can  change the type of sectors that
  399. X! are highlighted.  See the next two sections for the list of possible display
  400. X! and hightlight options.
  401. X  
  402. X! Normally, the conquer display shows your chosen display option with blank
  403. X! spaces to the right to space out the map nicely.  But, you may also use the
  404. X! area thus provided to show a secondary display.  This secondary display may
  405. X! be turned on and off using the '/' display selection.  Also, you may
  406. X! distinguish between what to display in the primary or secondary display by
  407. X! prefacing your selection with either a '1' or '2'.   If neither is chosen,
  408. X! then the primary display is set to the selected option, while the secondary
  409. X! display is turned off.
  410. X! END
  411. X!                             DISPLAY OPTIONS
  412. X  
  413. X! This section describes the possible display options proceeded by their
  414. X! associated keystroke:
  415. X  
  416. X!  (d)  designation:  show your designations and other nation's marks.
  417. X!  (r)  race:  show race of owned sectors (Human, Orc, Elf, Dwarf, Lizard, etc.)
  418. X!  (M)  move cost:  show the cost in movement points to move into a sector.
  419. X!  (p)  people:  show how many people live in a sector; arabic numbers indicate
  420. X!         the amount in hundreds, while 'I', 'V' and 'X' are used to indicate
  421. X!         at least one thousand, five thousand, and ten thousand respectively.
  422. X!  (D)  defense:  show the relative defensive strength of a sector.  Both sector
  423. X!         terrain and sector fortifications are taken into account.
  424. X!  (f)  food:  display relative food production ability of a sector.
  425. X!  (c)  contour:  display the elevation symbol of each sector.
  426. X!  (v)  vegetation:  display the vegetation symbol of each sector.
  427. X!  (m)  metal:  show the relative metal production ability of a sector.
  428. X!  (n)  nation mark:  display the national mark for all owned sectors.
  429. X!  (j)  jewels:  show the relative jewel production ability of a sector.
  430. X!  (i)  items:  display the designation neccesary to take advantage of the
  431. X!         special item in a sector.
  432. X! END
  433. X!                          HIGHLIGHT OPTIONS
  434. X! 
  435. X! This section describes the possible modes of highlighting proceeded by the
  436. X! keystroke used to select each:
  437. X! 
  438. X!  (o)  owned:  highlight all sectors owned by your country.
  439. X!  (a)  army:  highlight all sectors containing army units.
  440. X!  (y)  your army:  hightlight all sectors containing at least on of your
  441. X!         army units.
  442. X!  (l)  moves left:  hightlight any sectors containing one of your armies with
  443. X!         movement points remaining.
  444. X!  (s)  special:  highlight any sector containing a special item visable to
  445. X!         your nation.
  446. X!  (x)  none:  do not highlight any sectors.
  447. X! 
  448. X!    In general, the most useful displays are the production displays (food,
  449. X! metal, and jewels), and the most useful highlights are the army highlight
  450. X! (to show where your enemies are), and the moves left highlight (to indicate
  451. X! those units which may still be moved onto your enemies).
  452. X  END
  453. X                          COMMERCE AND TRADING
  454. X  
  455. X*** otxt4    Sun Aug  6 20:55:36 1989
  456. X--- txt4    Sun Aug  6 20:55:51 1989
  457. X***************
  458. X*** 57,63 ****
  459. X  ZCHURCH   add to your nations popularity and patriotism
  460. X  
  461. X  sector redesignation requires food ability of XDESFOOD (not forts/stockades).
  462. X! Stockade, City, Town, & Fort defences work for defenders with garrison status.
  463. X  END
  464. X                           MINE ABILITY & WEALTH
  465. X  
  466. X--- 57,63 ----
  467. X  ZCHURCH   add to your nations popularity and patriotism
  468. X  
  469. X  sector redesignation requires food ability of XDESFOOD (not forts/stockades).
  470. X! Stockade, City, Town, & Fort defenses work for defenders with garrison status.
  471. X  END
  472. X                           MINE ABILITY & WEALTH
  473. X  
  474. X*** otxt5    Sun Aug  6 20:55:36 1989
  475. X--- txt5    Sun Aug  6 20:55:51 1989
  476. X***************
  477. X*** 17,23 ****
  478. X  demon    1      0       1     0    1     0      5     0   4    O     DESTROYER
  479. X  dragon   0      0       0    10   20     0      0     0   4    O     MA_MONST
  480. X  shadow   1      0       0     0    0     5      0     0   2    O     VOID
  481. X! NPC      1      1       0     0    1     1      1     0   0    HDEO  None
  482. X  END
  483. X                                 ADDITIONAL SCORING
  484. X  
  485. X--- 17,23 ----
  486. X  demon    1      0       1     0    1     0      5     0   4    O     DESTROYER
  487. X  dragon   0      0       0    10   20     0      0     0   4    O     MA_MONST
  488. X  shadow   1      0       0     0    0     5      0     0   2    O     VOID
  489. X! monster  1      1       0     0    1     1      1     0   0    HDEO  None
  490. X  END
  491. X                                 ADDITIONAL SCORING
  492. X  
  493. X*** oman.pag    Sun Aug  6 20:55:34 1989
  494. X--- man.pag    Sun Aug  6 20:55:51 1989
  495. X***************
  496. X*** 3,12 ****
  497. X  conquer \- multiuser game of strategy
  498. X  .SH SYNOPSIS
  499. X  .B conquer
  500. X! [-hs -nNAT -dDIR]
  501. X  .sp
  502. X  .B conqrun
  503. X! [-maxp -dDIR ]
  504. X  .SH DESCRIPTION
  505. X  .I CONQUER
  506. X  is a multi player computer game designed to run under the UNIX
  507. X--- 3,12 ----
  508. X  conquer \- multiuser game of strategy
  509. X  .SH SYNOPSIS
  510. X  .B conquer
  511. X! [-Ghps -nNAT -dDIR]
  512. X  .sp
  513. X  .B conqrun
  514. X! [-max -dDIR ]
  515. X  .SH DESCRIPTION
  516. X  .I CONQUER
  517. X  is a multi player computer game designed to run under the UNIX
  518. X***************
  519. X*** 21,33 ****
  520. X  and adjusting economic activity, which is primarily geared to the production
  521. X  of gold for your treasury.  Metal is needed, however to build ships & armies,
  522. X  and food is needed to prevent revolts and keep people alive.
  523. X  .SH ON LINE HELP
  524. X  For detailed information, run conquer with the -h option (see below).
  525. X  .SH GAME OPTIONS
  526. X  .B conquer
  527. X! [-hs -nNAT -dDIR]
  528. X  .IP \-h
  529. X! print this help text
  530. X  .IP "\-n NTN"
  531. X  run as nation NTN
  532. X  .IP "\-d DIR"
  533. X--- 21,55 ----
  534. X  and adjusting economic activity, which is primarily geared to the production
  535. X  of gold for your treasury.  Metal is needed, however to build ships & armies,
  536. X  and food is needed to prevent revolts and keep people alive.
  537. X+ .SH ENVIRONMENT
  538. X+ Conquer now supports the environment variable CONQ_OPTS.  This allows
  539. X+ the setting of default values for nation name and data directory.  The
  540. X+ format is as follows:
  541. X+ .sp
  542. X+ .nf
  543. X+ setenv CONQ_OPTS "G,nation=MyLand,datadir=this_game"
  544. X+ .fi
  545. X+ .sp
  546. X+ If you then type just
  547. X+ .I conquer
  548. X+ to enter conquer, it will be equivalent to typing
  549. X+ .I conquer -G -n MyLand -d this_game.
  550. X+ .sp
  551. X+ The data directory and nation settings through the environment are
  552. X+ just defaults and maybe overridden by actually entering a different
  553. X+ option using '-d' or '-n'.  [Note: to specify the default directory,
  554. X+ you may simply specify '-d ""'.]
  555. X+ .sp
  556. X+ The CONQ_OPTS environment variable combined with the use of shell
  557. X+ aliases should allow quick access for players in multiple campaigns.
  558. X+ .fi
  559. X  .SH ON LINE HELP
  560. X  For detailed information, run conquer with the -h option (see below).
  561. X  .SH GAME OPTIONS
  562. X  .B conquer
  563. X! [-Ghps -nNAT -dDIR]
  564. X  .IP \-h
  565. X! display the conquer help files.
  566. X  .IP "\-n NTN"
  567. X  run as nation NTN
  568. X  .IP "\-d DIR"
  569. X***************
  570. X*** 34,58 ****
  571. X  Run on data in directory DIR.  Each game has its own data directory.  The
  572. X  default is set up at compile time and should only be used if only one game
  573. X  is run.
  574. X  .IP \-s
  575. X  print out scores
  576. X  .SH CONTROL OPTIONS
  577. X  .B conqrun
  578. X! [-maxp -dDIR ]
  579. X  .IP \-a     
  580. X  add new player    
  581. X  .IP \-m     
  582. X  make a world
  583. X- .IP \-p     
  584. X- print a map to standard output.    
  585. X  .IP \-x     
  586. X  execute program
  587. X  .IP "\-d DIR  "
  588. X! run on data in directory DIR
  589. X! It is suggested that each player set up an alias for their game & nation.
  590. X! My alias, for example, is
  591. X! .br
  592. X! .I conquer -nMordor -d/usr4/adb/games/conqlib2
  593. X  .SH CURSOR MOVEMENT
  594. X  .nf
  595. X  h: move west
  596. X--- 56,84 ----
  597. X  Run on data in directory DIR.  Each game has its own data directory.  The
  598. X  default is set up at compile time and should only be used if only one game
  599. X  is run.
  600. X+ .IP \-G
  601. X+ Gaudily highlight country name when reading the world news.
  602. X+ .IP \-p
  603. X+ Output a map of the world as visible by a nation.  The map is sent
  604. X+ to the standard output and interactive prompting is done through standard
  605. X+ error.  Therefore, the command:
  606. X+ .I conquer -p > foo
  607. X+ will create a file called foo containing the map.
  608. X  .IP \-s
  609. X  print out scores
  610. X  .SH CONTROL OPTIONS
  611. X  .B conqrun
  612. X! [-max -dDIR ]
  613. X  .IP \-a     
  614. X  add new player    
  615. X  .IP \-m     
  616. X  make a world
  617. X  .IP \-x     
  618. X  execute program
  619. X  .IP "\-d DIR  "
  620. X! run on data in directory DIR.  If DIR does not begin with a '/'
  621. X! character then the directory will be considered a sub directory of the
  622. X! default directory.
  623. X  .SH CURSOR MOVEMENT
  624. X  .nf
  625. X  h: move west
  626. X***************
  627. X*** 101,108 ****
  628. X  move selected unit. The unit will stop when it runs out
  629. X  of move points or runs into an army larger than it.
  630. X  .TP
  631. X  \'p\':
  632. X! .B pick item:
  633. X  allows you to select the next army or navy in the
  634. X  sector.  Other commands will operate on that unit.
  635. X  .TP
  636. X--- 127,139 ----
  637. X  move selected unit. The unit will stop when it runs out
  638. X  of move points or runs into an army larger than it.
  639. X  .TP
  640. X+ \'o\':
  641. X+ .B pick previous item:
  642. X+ allows you to select the previous army or navy in the
  643. X+ sector.  Other commands will operate on that unit.
  644. X+ .TP
  645. X  \'p\':
  646. X! .B pick next item:
  647. X  allows you to select the next army or navy in the
  648. X  sector.  Other commands will operate on that unit.
  649. X  .TP
  650. X***************
  651. X*** 119,125 ****
  652. X  \'t\':
  653. X  .B transport:
  654. X  unload or load a fleet with soldiers or civilians.
  655. X- .bp
  656. X  .TP
  657. X  \'w\':
  658. X  .B wizardry:
  659. X--- 150,155 ----
  660. X***************
  661. X*** 191,206 ****
  662. X  Civilians can move between two of your sectors at a cost
  663. X  of 50 per civilian.  Civilians move naturally in the update.
  664. X  .SH FILES
  665. X! /usr/games/lib/conquerdir/data    datafile for the running game
  666. X  .SH BUGS
  667. X! Probably lots, if you find any please mail them to adb@bucsf
  668. X  .sp
  669. X  1) Security is not as tight as it should be.  People might be able to alter
  670. X  the data of others nations... this is cheating and unacceptable.  
  671. X  .br
  672. X! 2) Naval battles do not work properly.
  673. X  .br
  674. X  3) NPC nations can not build navies or move over water.  God should be
  675. X  sure that all NPC nations have a minimum of 5 sectors to move to.
  676. X  .br
  677. X! 4) No comments about the documentation...  It needs to be updated.
  678. X--- 221,248 ----
  679. X  Civilians can move between two of your sectors at a cost
  680. X  of 50 per civilian.  Civilians move naturally in the update.
  681. X  .SH FILES
  682. X! /usr/games/lib/conquerdir/data    default datafile for the running game
  683. X! .SH MAILING LIST
  684. X! I have established a mailing list to provide a location for discussion
  685. X! of conquer, and for a place where I will bounce my ideas and test
  686. X! patches off of people.  If you would like to be added to the mailing
  687. X! list, send mail to
  688. X! .I conquer-news-request@bu-cs.bu.edu.
  689. X  .SH BUGS
  690. X! Probably lots, if you find any please mail them to either:
  691. X! .br
  692. X! .I adb@bu-cs.bu.edu
  693. X! or
  694. X! .I conquer-bugs@bu-cs.bu.edu.
  695. X  .sp
  696. X  1) Security is not as tight as it should be.  People might be able to alter
  697. X  the data of others nations... this is cheating and unacceptable.  
  698. X  .br
  699. X! 2) Naval battles may not work properly.
  700. X  .br
  701. X  3) NPC nations can not build navies or move over water.  God should be
  702. X  sure that all NPC nations have a minimum of 5 sectors to move to.
  703. X  .br
  704. X! 4) Documentation is becoming too large.  A better method for updating
  705. X! it and reading it should be implemented.  Some sections need sprucing
  706. X! up.
  707. SHAR_EOF
  708. chmod 0644 patchV4.04 || echo "restore of patchV4.04 fails"
  709. sed 's/^X//' << 'SHAR_EOF' > display.c &&
  710. X/*Print and io subroutines for interactive game*/
  711. X
  712. X/*conquer : Copyright (c) 1988 by Ed Barlow.
  713. X *  I spent a long time writing this code & I hope that you respect this.
  714. X *  I give permission to alter the code, but not to copy or redistribute
  715. X *  it without my explicit permission.    If you alter the code,
  716. X *  please document changes and send me a copy, so all can have it.
  717. X *  This code, to the best of my knowledge works well,     but it is my first
  718. X *  'C' program and should be treated as such.  I disclaim any
  719. X *  responsibility for the codes actions (use at your own risk).     I guess
  720. X *  I am saying "Happy gaming", and am trying not to get sued in the process.
  721. X *                                        Ed
  722. X */
  723. X
  724. X/*include files*/
  725. X#include <ctype.h>
  726. X#include "header.h"
  727. X#include "data.h"
  728. X
  729. X/*offset of upper left hand corner*/
  730. Xextern short xoffset;
  731. Xextern short yoffset;
  732. X/*current cursor postion (relative to 00 in upper corner)*/
  733. X/*    position is 2*x,y*/
  734. Xextern short xcurs;
  735. Xextern short ycurs;
  736. X/*redraw map in this turn if redraw is a 1*/
  737. Xextern short redraw;
  738. X/*display state SEE data.h FOR CURRENT VALUES OF THESE */
  739. Xextern short hilmode;
  740. Xextern short dismode;
  741. Xextern short otherdismode;
  742. Xextern short otherhilmode;
  743. X
  744. X/* nation id of owner*/
  745. Xextern short country;
  746. X
  747. Xstatic char *hasseen;
  748. X
  749. X/* allocate space for the hasseen array based on the actual screen size */
  750. Xvoid
  751. Xinit_hasseen()
  752. X{
  753. X    hasseen = (char *)malloc(((COLS-10)/2) * (LINES-5));
  754. X#ifdef BSD
  755. X    bzero(hasseen,((COLS-10)/2) * (LINES-5));
  756. X#else
  757. X    memset( hasseen, 0, ((COLS-10)/2) * (LINES-5));
  758. X#endif
  759. X    if (hasseen == (char *)NULL) {
  760. X        errormsg("Cannot allocate memory.");
  761. X        bye(FALSE);
  762. X    }
  763. X}
  764. X
  765. X/*make a map*/
  766. Xvoid
  767. Xmakemap()
  768. X{
  769. X    register int x,y;
  770. X
  771. X    for(x=0;x<SCREEN_X_SIZE;x++) for(y=0;y<SCREEN_Y_SIZE;y++)
  772. X    if( HAS_SEEN(x,y) ) {
  773. X        highlight(x,y,hilmode);
  774. X        see(x,y);
  775. X    }
  776. X    move(ycurs,2*xcurs);
  777. X}
  778. X
  779. X
  780. Xvoid
  781. Xget_display_mode(dmode,hmode,odmode,ohmode)
  782. X    short *dmode, *hmode, *odmode, *ohmode;
  783. X{
  784. X    short temp;
  785. X    
  786. X    mvaddstr(LINES-4,0,"viewing options:  (d)esignation, (r)ace, (M)ove cost, (p)eople, (D)efense");
  787. X    clrtoeol();
  788. X    mvaddstr(LINES-3,0,"   (f)ood, (c)ontour, (v)egetation, (m)etal, (n)ation mark, (j)ewels, (i)tems");
  789. X    clrtoeol();
  790. X    mvaddstr(LINES-2,0,"highlight option: (o)wned, (a)rmy, (y)our Army, move (l)eft, (s)pecial,(x)=none");
  791. X    clrtoeol();
  792. X    if ( odmode !=NULL) {
  793. X        mvaddstr(LINES-1,0,"Toggle second display: '/'; set display: '1' or '2'");
  794. X    } else {
  795. X        mvprintw(LINES-1,0,"     choose selection for the %s display",
  796. X            (*ohmode == 1) ? "primary" : "secondary");
  797. X    }
  798. X    clrtoeol();
  799. X    standout();
  800. X    mvaddstr(LINES-1,COLS-25,odmode!=NULL?"what display?:":"display?:");
  801. X    standend();
  802. X    refresh();
  803. X    redraw=TRUE;
  804. X    switch(getch()) {
  805. X    case '/':
  806. X        if (odmode !=NULL)
  807. X            *odmode = - *odmode;
  808. X        else
  809. X            goto error;
  810. X        break;
  811. X    case '2':
  812. X        temp = 2;
  813. X        if (odmode !=NULL)
  814. X            get_display_mode(odmode,ohmode,NULL,&temp);
  815. X        else
  816. X            goto error;
  817. X        break;
  818. X    case '1':
  819. X        temp = 1;
  820. X        if (odmode !=NULL)
  821. X            get_display_mode(dmode,hmode,NULL,&temp);
  822. X        else
  823. X            goto error;
  824. X        break;
  825. X    case 'f':
  826. X        *dmode=DI_FOOD;
  827. X        goto changed_display;
  828. X    case 'v':    /* vegetation map*/
  829. X        *dmode=DI_VEGE;
  830. X        goto changed_display;
  831. X    case 'd':    /* designations map*/
  832. X        *dmode=DI_DESI;
  833. X        goto changed_display;
  834. X    case 'c':    /* contour map of world */
  835. X        *dmode=DI_CONT;
  836. X        goto changed_display;
  837. X    case 'n':    /* nations map*/
  838. X        *dmode=DI_NATI;
  839. X        goto changed_display;
  840. X    case 'r':    /* race map*/
  841. X        *dmode=DI_RACE;
  842. X        goto changed_display;
  843. X    case 'M': /* move cost map */
  844. X        *dmode=DI_MOVE;
  845. X        goto changed_display;
  846. X    case 'D':
  847. X        *dmode=DI_DEFE;
  848. X        goto changed_display;
  849. X    case 'p':
  850. X        *dmode=DI_PEOP;
  851. X        goto changed_display;
  852. X    case 'j':
  853. X        *dmode=DI_GOLD;
  854. X        goto changed_display;
  855. X    case 'm':
  856. X        *dmode=DI_METAL;
  857. X        goto changed_display;
  858. X    case 'i':
  859. X        *dmode=DI_ITEMS;
  860. X    changed_display:
  861. X        if ( odmode !=NULL && *odmode > 0) /* just 'd' not 'd1 or 'd2' */
  862. X            *odmode= - *odmode;
  863. X        break;
  864. X    case 'a':    /* armies hilighted map*/
  865. X        prep(country,FALSE);
  866. X        *hmode=HI_ARMY;
  867. X        goto changed_highlight;
  868. X    case 'o':    /* owners hilighted map*/
  869. X        *hmode=HI_OWN;
  870. X        goto changed_highlight;
  871. X    case 's':    /* hilight tradegoods */
  872. X        *hmode=HI_GOOD;
  873. X        goto changed_highlight;
  874. X    case 'x':    /*no highlighting*/
  875. X        *hmode=HI_NONE;
  876. X        goto changed_highlight;
  877. X    case 'y':    /* your armies hilighted map*/
  878. X        prep(country,FALSE);
  879. X        *hmode=HI_YARM;
  880. X        goto changed_highlight;
  881. X    case 'l':    /* your armies with moves left hilighted map*/
  882. X        prep(country,FALSE);
  883. X        *hmode=HI_MOVE;
  884. X    changed_highlight:
  885. X        if ( odmode !=NULL ) /* just 'd' not 'd1 or 'd2' */
  886. X            *ohmode= *hmode;
  887. X        break;
  888. X    default:
  889. X    error:
  890. X        beep();
  891. X        redraw=FALSE;
  892. X    }
  893. X}
  894. X
  895. Xvoid
  896. Xnewdisplay()
  897. X{
  898. X    get_display_mode(&dismode,&hilmode,&otherdismode,&otherhilmode);
  899. X    makebottom();
  900. X}
  901. X
  902. X/*see what is in xy as per display modes*/
  903. Xchar
  904. Xget_display_for(x,y,dmode)
  905. X    int x,y;
  906. X    short dmode;
  907. X{
  908. X    int armbonus;
  909. X
  910. X    char ch= '{';
  911. X    if((magic(sct[x+xoffset][y+yoffset].owner,THE_VOID)==TRUE)
  912. X       &&((dmode==DI_DEFE)||(dmode==DI_GOLD)||(dmode==DI_METAL)
  913. X         ||(dmode==DI_PEOP)||(dmode==DI_FOOD)||(dmode==DI_ITEMS))
  914. X       &&(country!=sct[x+xoffset][y+yoffset].owner)
  915. X       &&(magic(country,NINJA)!=TRUE)
  916. X       &&(country!=0)) {
  917. X        ch='?';
  918. X    } else {
  919. X        switch(dmode){
  920. X        case DI_FOOD:    /*food */
  921. X            if(tofood( &sct[x+xoffset][y+yoffset],country)==0)
  922. X                ch=sct[x+xoffset][y+yoffset].vegetation;
  923. X            else if (tofood( &sct[x+xoffset][y+yoffset],country)<10)
  924. X                ch=tofood( &sct[x+xoffset][y+yoffset],country)+'0';
  925. X            else ch='+';
  926. X            break;
  927. X        case DI_VEGE: /*vegetation*/
  928. X            ch=sct[x+xoffset][y+yoffset].vegetation;
  929. X            break;
  930. X        case DI_DESI: /*designation*/
  931. X            if(sct[x+xoffset][y+yoffset].owner==0){
  932. X                if(tofood( &sct[x+xoffset][y+yoffset],sct[x+xoffset][y+yoffset].owner)!=0)
  933. X                    ch=sct[x+xoffset][y+yoffset].altitude;
  934. X                else ch=sct[x+xoffset][y+yoffset].vegetation;
  935. X            }
  936. X            else if((country==0)
  937. X                   ||(sct[x+xoffset][y+yoffset].owner==country))
  938. X                ch=sct[x+xoffset][y+yoffset].designation;
  939. X            else ch=ntn[sct[x+xoffset][y+yoffset].owner].mark;
  940. X            break;
  941. X        case DI_CONT: /*contour*/
  942. X            ch=sct[x+xoffset][y+yoffset].altitude;
  943. X            break;
  944. X        case DI_NATI: /*ownership*/
  945. X            if(sct[x+xoffset][y+yoffset].owner==0)
  946. X                ch=sct[x+xoffset][y+yoffset].altitude;
  947. X            else ch=ntn[sct[x+xoffset][y+yoffset].owner].mark;
  948. X            break;
  949. X        case DI_RACE: /*race*/
  950. X            if(sct[x+xoffset][y+yoffset].owner==0)
  951. X                ch=sct[x+xoffset][y+yoffset].altitude;
  952. X            else ch=ntn[sct[x+xoffset][y+yoffset].owner].race;
  953. X            break;
  954. X        case DI_MOVE:    /*movement cost map*/
  955. X            if(movecost[x+xoffset][y+yoffset]>=0) {
  956. X                if(movecost[x+xoffset][y+yoffset]>=10)
  957. X                    ch='+';
  958. X                else ch=movecost[x+xoffset][y+yoffset]+'0';
  959. X            } else if(sct[x+xoffset][y+yoffset].altitude==WATER)
  960. X                ch=WATER;
  961. X            else
  962. X                ch='X';
  963. X            break;
  964. X        case DI_DEFE:     /*Defence*/
  965. X            if (sct[x+xoffset][y+yoffset].altitude==WATER)
  966. X                ch=WATER;
  967. X            else if(movecost[x+xoffset][y+yoffset]<0)
  968. X                ch='X';
  969. X            else {
  970. X                /*Racial combat bonus due to terrain (the faster you move the better)*/
  971. X                armbonus=0;
  972. X                armbonus+=5*(9-movecost[x+xoffset][y+yoffset]);
  973. X                
  974. X                if(sct[x+xoffset][y+yoffset].altitude==MOUNTAIN)
  975. X                    armbonus+=40;
  976. X                else if(sct[x+xoffset][y+yoffset].altitude==HILL)
  977. X                    armbonus+=20;
  978. X
  979. X                if(sct[x+xoffset][y+yoffset].vegetation==JUNGLE)
  980. X                    armbonus+=30;
  981. X                else if(sct[x+xoffset][y+yoffset].vegetation==FOREST)
  982. X                    armbonus+=20;
  983. X                else if(sct[x+xoffset][y+yoffset].vegetation==WOOD)
  984. X                    armbonus+=10;
  985. X
  986. X                armbonus+=fort_val(&sct[x+xoffset][y+yoffset]);
  987. X                
  988. X                if(armbonus<200) ch=armbonus/20+'0';
  989. X                else ch='+';
  990. X            }
  991. X            break;
  992. X        case DI_PEOP:     /*People*/
  993. X            if (sct[x+xoffset][y+yoffset].altitude==WATER)
  994. X                ch=WATER;
  995. X            else if (sct[x+xoffset][y+yoffset].people>=9950)
  996. X                ch='X';
  997. X            else if (sct[x+xoffset][y+yoffset].people>=4950)
  998. X                ch='V';
  999. X            else if (sct[x+xoffset][y+yoffset].people>=950)
  1000. X                ch='I';
  1001. X            else
  1002. X                ch=(50+sct[x+xoffset][y+yoffset].people)/100+'0';
  1003. X            break;
  1004. X        case DI_GOLD:    /*Gold*/
  1005. X            if (sct[x+xoffset][y+yoffset].altitude==WATER)
  1006. X                ch=WATER;
  1007. X            else if(tofood( &sct[x+xoffset][y+yoffset],country)==0)
  1008. X                ch='X';
  1009. X            else if (tg_ok(country,&sct[x+xoffset][y+yoffset])){
  1010. X                if (sct[x+xoffset][y+yoffset].jewels>=10)
  1011. X                    ch='+';
  1012. X                else
  1013. X                    ch=sct[x+xoffset][y+yoffset].jewels+'0';
  1014. X            } else ch='0';
  1015. X            break;
  1016. X        case DI_METAL:     /*Metal*/
  1017. X            if (sct[x+xoffset][y+yoffset].altitude==WATER)
  1018. X                ch=WATER;
  1019. X            else if(tofood( &sct[x+xoffset][y+yoffset],country)==0)
  1020. X                ch='X';
  1021. X            else if (tg_ok(country,&sct[x+xoffset][y+yoffset])){
  1022. X                if (sct[x+xoffset][y+yoffset].metal>=10)
  1023. X                    ch='+';
  1024. X                else
  1025. X                    ch=sct[x+xoffset][y+yoffset].metal+'0';
  1026. X            } else ch='0';
  1027. X            break;
  1028. X        case DI_ITEMS:    /* designations needed for tradegoods */
  1029. X            if (sct[x+xoffset][y+yoffset].altitude==WATER)
  1030. X                ch=WATER;
  1031. X            else if(tofood( &sct[x+xoffset][y+yoffset],country)==0)
  1032. X                ch='X';
  1033. X            else if (sct[x+xoffset][y+yoffset].tradegood!=TG_none
  1034. X            && (*(tg_stype+sct[x+xoffset][y+yoffset].tradegood)!='x')
  1035. X                && tg_ok(country,&sct[x+xoffset][y+yoffset]))
  1036. X                ch= *(tg_stype+sct[x+xoffset][y+yoffset].tradegood);
  1037. X            else ch='-';
  1038. X            break;
  1039. X        default:
  1040. X            break;
  1041. X        }
  1042. X    }
  1043. X    return ch;
  1044. X}
  1045. X
  1046. Xvoid
  1047. Xsee(x,y)
  1048. X{
  1049. X    char ch;
  1050. X    if((x<0)||(y<0)||(x>=SCREEN_X_SIZE)||(y>=SCREEN_Y_SIZE)
  1051. X    ||((y+yoffset)>=MAPY)||((x+xoffset)>=MAPX)) return;
  1052. X    if(((y+yoffset)<MAPY)&&((x+xoffset)<MAPX)) {
  1053. X        ch=get_display_for(x,y,dismode);
  1054. X        mvaddch(y,2*x,ch);
  1055. X        if ( otherdismode > 0 ) {
  1056. X            highlight(x,y,otherhilmode);
  1057. X            ch=get_display_for(x,y,otherdismode,otherhilmode);
  1058. X            mvaddch(y,2*x+1,ch);
  1059. X        }
  1060. X    }
  1061. X    else {
  1062. X        mvaddch(y,2*x,' ');
  1063. X        mvaddch(y,2*x+1,' ');
  1064. X    }
  1065. X}
  1066. X
  1067. X/*highlight what is in xy as per highlight mode*/
  1068. Xvoid
  1069. Xhighlight(x,y,hmode)
  1070. X    short hmode;
  1071. X{
  1072. X    int    armynum;
  1073. X    if((x<0)||(y<0)||(x>=SCREEN_X_SIZE)||(y>=SCREEN_Y_SIZE)
  1074. X    ||((y+yoffset)>=MAPY)||((x+xoffset)>=MAPX)) return;
  1075. X    standend();
  1076. X    switch(hmode){
  1077. X    case HI_MOVE:    /* your armies w/ move left */
  1078. X        for(armynum=0;armynum<MAXARM;armynum++)
  1079. X            if(( P_ASOLD != 0 )
  1080. X            &&( P_AMOVE != 0 )
  1081. X            &&( P_AXLOC==(x+xoffset ))
  1082. X            &&( P_AYLOC==(y+yoffset ))) break;
  1083. X        if(armynum<MAXARM) standout();
  1084. X        break;
  1085. X    case HI_YARM:    /* your armies */
  1086. X        for(armynum=0;armynum<MAXARM;armynum++)
  1087. X            if(( P_ASOLD != 0)
  1088. X            &&( P_AXLOC==x+xoffset)
  1089. X            &&( P_AYLOC==y+yoffset)) break;
  1090. X        if(armynum<MAXARM) standout();
  1091. X        break;
  1092. X    case HI_GOOD:    /* trade goods */
  1093. X        if(tg_ok( country, &sct[x+xoffset][y+yoffset])
  1094. X           &&(sct[x+xoffset][y+yoffset].tradegood != TG_none)
  1095. X           &&(magic(sct[x+xoffset][y+yoffset].owner,THE_VOID)!=TRUE
  1096. X            || country==0
  1097. X            || country==sct[x+xoffset][y+yoffset].owner
  1098. X            || magic(country,NINJA)==TRUE)
  1099. X           &&(sct[x+xoffset][y+yoffset].altitude!=WATER)) standout();
  1100. X        break;
  1101. X    case HI_OWN: /* ownership */
  1102. X        if(country==0) {
  1103. X            if(sct[x+xoffset][y+yoffset].owner!=0)
  1104. X                standout();
  1105. X        } else if(sct[x+xoffset][y+yoffset].owner==country)
  1106. X            standout();
  1107. X        break;
  1108. X    case HI_ARMY: /* any armies */
  1109. X        if(occ[x+xoffset][y+yoffset]!=0) standout();
  1110. X        break;
  1111. X    default:
  1112. X        break;
  1113. X    }
  1114. X}
  1115. X
  1116. X/* check if cursor is out of bounds*/
  1117. Xvoid
  1118. Xcoffmap()
  1119. X{
  1120. X    if((xcurs<=0)||(ycurs<=0)||(xcurs>=SCREEN_X_SIZE-1)
  1121. X    ||((ycurs>=SCREEN_Y_SIZE-1))||((XREAL)>=MAPX)
  1122. X     ||((YREAL)>=MAPY)) offmap();
  1123. X    
  1124. X    if( redraw==TRUE) {
  1125. X        clear();
  1126. X        makemap();     /* update map */
  1127. X        makebottom();
  1128. X        redraw=FALSE;
  1129. X    }
  1130. X    move(ycurs,2*xcurs);
  1131. X    makeside(FALSE);  /*update side*/
  1132. X    move(ycurs,2*xcurs);
  1133. X    refresh();
  1134. X}
  1135. X
  1136. Xint
  1137. Xcanbeseen(x,y)
  1138. Xint    x,y;
  1139. X{
  1140. X    if(!ONMAP(x,y)) return(FALSE);
  1141. X    return( (int) HAS_SEEN(x-xoffset,y-yoffset) );
  1142. X}
  1143. X
  1144. X/** CANSEE() fills seen[SCREEN_X_SIZE][SCREEN_Y_SIZE] */
  1145. Xvoid
  1146. Xwhatcansee()
  1147. X{
  1148. X    register int x,y;
  1149. X    int    i,j;
  1150. X    short    armynum,nvynum;
  1151. X
  1152. X    if((magic(country,KNOWALL)==TRUE)||(country==0)) {
  1153. X        for(x=0;x<SCREEN_X_SIZE;x++) for(y=0;y<SCREEN_Y_SIZE;y++)
  1154. X            HAS_SEEN(x,y)=TRUE;
  1155. X        return;
  1156. X    }
  1157. X    for(x=0;x<SCREEN_X_SIZE;x++) for(y=0;y<SCREEN_Y_SIZE;y++)
  1158. X        HAS_SEEN(x,y)=FALSE;
  1159. X
  1160. X    for(x=(-LANDSEE);(x<SCREEN_X_SIZE+LANDSEE);x++)
  1161. X    for(y=(-LANDSEE);(y<SCREEN_Y_SIZE+LANDSEE);y++)
  1162. X    if((ONMAP(x+xoffset,y+yoffset))
  1163. X    &&(sct[x+xoffset][y+yoffset].owner==country)){
  1164. X        for(i=x-LANDSEE;i<=x+LANDSEE;i++)
  1165. X        for(j=y-LANDSEE;j<=y+LANDSEE;j++)
  1166. X        if(i>=0 && j>=0 && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
  1167. X            if (ONMAP(i+xoffset,j+yoffset))
  1168. X                HAS_SEEN(i,j)=TRUE;
  1169. X    }
  1170. X
  1171. X    for(nvynum=0;nvynum<MAXNAVY;nvynum++)
  1172. X    if((P_NMSHP!=0)||(P_NWSHP!=0)||(P_NGSHP!=0))
  1173. X        for(i=(int)P_NXLOC-xoffset-NAVYSEE;i<=(int)P_NXLOC-xoffset+NAVYSEE;i++)
  1174. X        for(j=(int)P_NYLOC-yoffset-NAVYSEE;j<=(int)P_NYLOC-yoffset+NAVYSEE;j++)
  1175. X            if(ONMAP(i+xoffset,j+yoffset) && i>=0 && j>=0
  1176. X            && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
  1177. X                HAS_SEEN(i,j)=TRUE;
  1178. X
  1179. X    for(armynum=0;armynum<MAXARM;armynum++)
  1180. X        if(P_ASOLD>0)
  1181. X        for(i=(int)P_AXLOC-xoffset-ARMYSEE;i<=(int)P_AXLOC-xoffset+ARMYSEE;i++)
  1182. X        for(j=(int)P_AYLOC-yoffset-ARMYSEE;j<=(int)P_AYLOC-yoffset+ARMYSEE;j++)
  1183. X        if(ONMAP(i+xoffset,j+yoffset) && i>=0 && j>=0
  1184. X        && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
  1185. X            HAS_SEEN(i,j)=TRUE;
  1186. X
  1187. X    return;
  1188. X}
  1189. SHAR_EOF
  1190. chmod 0644 display.c || echo "restore of display.c fails"
  1191. rm -f s2_seq_.tmp
  1192. echo "You have unpacked the last part"
  1193. exit 0
  1194.